﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Rhino.Mocks;
using Affirma.ThreeSharp.Wrapper;
using System.IO;

namespace CloudDrive.S3.Tests
{
    [TestFixture]
    public class S3ProxyTests
    {
        [Test]
        public void CreateFileReturnsFileObjectWithSameKey()
        {
            var wrapper = MockRepository.GenerateMock<IThreeSharpWrapper>();
            wrapper.Stub(x => x.ListBucket(null)).IgnoreArguments().Return(File.ReadAllText("ListBucketWithSingleTestFile.xml"));
            S3Proxy proxy = new S3Proxy(wrapper, string.Empty);
            var file = proxy.CreateFile("FileName.txt", false);
            Assert.AreEqual(file.KeyName, "FileName.txt");
        }
    }
}
